import Layout from '@/layout'
export default {
    path: '/house',
    component: Layout,
    redirect: '/house',
    name: 'House',
    meta: {
        title: '房屋管理',
        icon: 'clipboard',
    },
    children: [
        {
            path: 'information',
            component: () => import('@/views/house/information'),
            name: 'Information',
            meta: { title: '房屋信息管理', icon: '' }
        },
        {
            path: 'category',
            component: () => import('@/views/house/category'),
            name: 'Category',
            meta: { title: '公用数据配置', icon: '' }
        },
        {
            path: 'information/edit/:id?/:isDisabled?',
            component: () => import('@/views/house/information/edit.vue'),
            name: 'Edit',
            beforeEnter: (to, from, next) => {
                if (to.params.id) {
                    to.meta.title = '编辑';
                    if (to.params.isDisabled ==='1') {
                        to.meta.title = '详情';
                    }
                } else {
                    to.meta.title = '新增';
                }
                next();
            },
            meta: {
                title: '新增', // 默认值
                noCache: true,
                activeMenu: `/house/information/index`
            },
            hidden: true
        }
    ]
}
